package com.letu.core.context;

import com.letu.annotation.database.mybatis.auth.DataScopeOfUserId;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 跟上下文常量工具类
 *
 * @author ligang
 * @date 2018/12/21
 */
public final class ContextConstants {
    private ContextConstants() {
    }

    /**
     * JWT中封装的 用户id
     */
    public static final String JWT_KEY_USER_ID = "userid";
    /**
     * JWT中封装的 用户名称
     */
    public static final String JWT_KEY_NAME = "name";

    /**
     * JWT中封装的 用户真实名称
     */
    public static final String JWT_KEY_REAL_NAME = "realName";


    /**
     * JWT中封装的 是否业务管理员 1是0否
     */
    public static final String JWT_KEY_IS_ADMIN = "isAdmin";
    /**
     * JWT中封装的 是否超级管理员 1是0否
     */
    public static final String JWT_KEY_IS_SUPER_ADMIN = "isSuperAdmin";

    /**
     * JWT中封装的 用户账号
     */
    public static final String JWT_KEY_ACCOUNT = "account";

    /**
     * JWT中封装的 项目id
     */
    public static final String JWT_KEY_PROJECT_ID = "projectId";

    /**
     * JWT中封装的 租户id
     */
    public static final String JWT_KEY_TENANT_ID = "tenantId";


    /**
     * 租户id集合 给系统管理员用
     */
    public static final String JWT_KEY_TENANT_ID_LIST = "tenantIdList";


    /**
     *  是否需要忽略系统数据隔离
     */
    public static final String IS_SYSTEM_OLATION_IGNORE = "isSystemOlationIgnore";

    /**
     *  是否需要忽略自定义租户模式
     */
    public static final String IS_SYSTEM_TENANT_IGNORE = "isSystemTenantIgnore";

    /**
     * ip地址 本机ip
     */
    public static final String IPADDR = "ipAddr";


    /**
     * 是否本地环境
     */
    public static final String PROFILE_ACTIVE = "profiles_active";

    /**
     * 系统重启时间
     */
    public static final String RELOAD_TIME = "reload_time";


    /**
     * 租户规则数据
     */
    public static final String TENANT_RULE = "tenant_rule";



    /**
     * JWT token 签名
     * <p>
     * 签名密钥长度至少32位!!!
     */
//    public static final String JWT_SIGN_KEY = "lamp-cloud_is_a_fantastic_project";

    public static final String JWT_SIGN_KEY = "lamp_game_2023_letu";
    /**
     * 刷新 Token
     */
    public static final String REFRESH_TOKEN_KEY = "refresh_token";

    /**
     * User信息 认证请求头
     */
    public static final String BEARER_HEADER_KEY = "token";
    /**
     * User信息 认证请求头前缀
     */
    public static final String BEARER_HEADER_PREFIX = "Bearer ";
    /**
     * User信息 认证请求头前缀
     */
    public static final String BEARER_HEADER_PREFIX_EXT = "Bearer%20";

    /**
     * Client信息认证请求头
     */
    public static final String BASIC_HEADER_KEY = "Authorization";

    /**
     * Client信息认证请求头前缀
     */
    public static final String BASIC_HEADER_PREFIX = "Basic ";

    /**
     * Client信息认证请求头前缀
     */
    public static final String BASIC_HEADER_PREFIX_EXT = "Basic%20";

    /**
     * 是否 内部调用项目 (用于项目间feign调用)
     */
    public static final String FEIGN = "x-feign";
//    /**
//     * 日志链路追踪id信息头
//     */
//    public static final String TRACE_ID_HEADER = "x-trace-header";
    /**
     * 日志链路追踪id日志标志
     */
    public static final String LOG_TRACE_ID = "trace";

    /**
     * 灰度发布版本号
     */
    public static final String GRAY_VERSION = "grayversion";

    /**
     * 权重
     */
    public static final String WIGHT = "wight";


    /**
     * 项目code码
     */
    public static final String PROJECT_CODE = "project_code";

    /**
     * 埋点
     */
    public static final String POINT = "point";

    /**
     * 埋点类型
     */
    public static final String POINT_TYPE = "pointtype";

    /**
     * 日志IP地址信息头
     */
    public static final String IP_HEADER = "ip";

    /**
     * 展会id
     */
    public static final String EXHIBITION_ID = "exhibitionId";

    /**
     * 语言环境(cn/en)
     */
    public static final String LANGUAGE_TYPE = "languageType";

    /**
     * 请求来源版本信息
     */
    public static final String TERMINAL_DEVICE = "terminalDevice";

    /**
     * 请求来源类型 （web/app/mini_programs）
     */
    public static final String TERMINAL_TYPE = "terminalType";


    /**
     * 使用主体类型 VISITOR:观众;ACTOR:展商;SPONSOR:主办;EMPLOYEE 员工
     */
    public static final String SUBJECT_TYPE = "subjectType";


    /**
     * JWT中封装的 租户编码
     */
    public static final String JWT_KEY_TENANT = "tenant";


    /**
     * JWT中封装的 用户类型
     */
    public static final String JWT_KEY_SUBJECTTYPE = "subjectType";


    /**
     * 雪花id--workid
     */
    public static Long WORK_ID = 0L;


    /**
     * 归属系统#{BOOKING_OUT:场馆对外门户;OPERATOR_OUT:运营公司对外门户;USER_CENTER:用户中心
     */
    public static final String MENU_AFFILIATION = "menuAffiliation";

    /**
     * 场景#{MANAGE:后台菜单;WORK:工作台菜单;APP:前端菜单;-枚举
     */
    public static final String MENU_SCENE = "menuScene";


    /**
     * 系统场景{P_VENUE:场馆业务管理系统;P_CERTIFICATE:证件管理系统;P_COMPOSITE_VENUE:综合-场馆管理; P_COMPOSITE_COURT:综合-主场管理;P_COMPOSITE_PRODUCER:综合-搭建商管理;P_COMPOSITE_TRANSPORT:综合-主运管理;P_COMPOSITE_TRADE:综合-商旅管理;P_COMPOSITE_MATING:综合-配套商管理;P_PAY:支付系统;P_EXHIBITOR_SELF:展商自服务;P_CATERINGAPP:餐饮小程序;P_CATERING:餐饮后台服务;P_PORTAL_OUT_VENUE:对外门户-场馆后台;P_PORTAL_OUT_OPERATION:对外门户-运营后台;P_PORTAL_IN_WORK:内部门户-工作后台;P_PORTAL_IN_WORKAPP:内部门户-工作APP;P_OPERATION_CENTER:智慧运营中心系统;P_VISITOR_FRONT:访客前台系统;P_VISITOR_BACK:访客后台系统;P_R_EXHIBITOR:展商组;P_R_SPONSOR:主办组;P_R_BUILDER:搭建商组;P_R_COURT:主场组;P_R_TRANSPORT:主运组;P_R_BOOKING:场馆方组;P_R_REPAST:餐饮方组;EXHIBITOR:展商;EXHIBITOR_STAFF:展商员工;SPONSOR:主办;SPONSOR_STAFF:主办员工;BUILDER:搭建商;BUILDER_STAFF:搭建商员工;COURT:主场;COURT_STAFF:主场员工;TRANSPORT:主运;TRANSPORT_STAFF:主运员工;BOOKING:场馆方;BOOKING_STAFF:场馆方员工;REPAST:餐饮方;REPAST_STAFF:餐饮方员工;STAFF:员工;OTHER:其他}", replace = {"厦门智慧场馆_P", "场馆业务管理系统_P_VENUE", "证件管理系统_P_CERTIFICATE", "综合-场馆管理_P_COMPOSITE_VENUE", "综合-主场管理_P_COMPOSITE_COURT", "综合-搭建商管理_P_COMPOSITE_PRODUCER", "综合-主运管理_P_COMPOSITE_TRANSPORT", "综合-商旅管理_P_COMPOSITE_TRADE", "综合-配套商管理_P_COMPOSITE_MATING", "支付系统_P_PAY", "展商自服务_P_EXHIBITOR_SELF", "餐饮小程序_P_CATERINGAPP", "餐饮后台服务_P_CATERING", "对外门户-场馆后台_P_PORTAL_OUT_VENUE", "对外门户-运营后台_P_PORTAL_OUT_OPERATION", "内部门户-工作后台_P_PORTAL_IN_WORK", "内部门户-工作APP_P_PORTAL_IN_WORKAPP", "智慧运营中心系统_P_OPERATION_CENTER", "访客前台系统_P_VISITOR_FRONT", "访客后台系统_P_VISITOR_BACK"}
     */
    public static final String SYSTEM_SCENE = "systemScene";

    /**
     * 是否进行数据权限操作
     */
    public static final String IS_DATASCOPE = "isDataScope";


    /**
     * 数据权限数据
     */
    public static final String DATA_SCOPE_OF_USERID = "dataScopeOfUserId";


    /**
     * ES 索引后缀  按月进行后缀
     */
    public static final String ES_INDEX_SUFFIX = "";
    /**
     * 字典翻译文本后缀
     */
    public static final String DICT_TEXT_SUFFIX = "DictText";


    /**
     * 系统数据
     */
    public static final String DATA_ISOLATION = "DataIsolationVo";



    /**
     * 项目系统标识
     */
    public static final String PROJECT_SYSTEM_SCENE = "projectSystemScene";

    /**
     * 本项目调用业务服务 数据隔离级别
     */
    public static final String STATIC_PROJECT_SYSTEM_DATA_SCOPE = "staticProjectSystemDataScope";



    /**
     * 项目名称
     */
    public static final String APPLICATION_NAME = "applicationName";


//    /**
//     * 是否是基础服务
//     */
//    public static final String IS_BASIC_SYSTEM = "iSBasicSystem";

//    /**
//     * 系统标识  BUSIN业务系统，basic基础服务
//     */
//    public static final String SYSTEM_TAG = "systemTag";


    /**
     * 网关 -token
     */
    public static final String GATEWAY_TOKEN = "gatewayToken";

    /**
     * 网关 -创建时间
     */
    public static final String GATEWAY_CREATE_TIME = "gatewayCreateTime";

    /**
     * 网关 -请求地址
     */
    public static final String GATEWAY_RQUEST_URL = "gatewayUrl";

    /**
     * 网关 -请求方法
     */
    public static final String GATEWAY_RQUEST_METHOD = "gatewayMethod";


    /**
     * 网关 -请求参数
     */
    public static final String GATEWAY_RQUEST_PARAMS = "gatewayParams";



    /**
     * 本项目唯一标识id
     */
    public static final String STATIC_PROJECT_WORK_ID = "projectWorkId";




    /**
     * 网关是否过滤url
     */
    public static final String IS_IGNORE_URL = "isIgnoreUrl";





    /**
     * 游戏标识
     */
    public static final String JWT_KEY_GAME_TAG = "x-ct-etag";


    /**
     * 游戏标识
     */
    public static final String JWT_KEY_GAME_TAG_SMALL = "xctetag";
    /**
     * 游戏标识
     */
    public static final String JWT_KEY_PHONE_ID = "phoneid";


    /**
     * DB 指定
     */
    public static final String DB_NUMBER = "dbNum";


    /**
     * table 指定
     */
    public static final String TABLE_NUMBER = "tableNum";


    /**
     * JWT中封装的 用户地区
     */
    public static final String JWT_KEY_USER_AREA_CODE = "areacode";


    /**
     * 用户业务id
     */
    public static final String USER_BUSINESS_ID = "userBusinessId";



    public final static String DEFAULT_ONE_CENT_STR = "0.01";
    public final static BigDecimal DEFAULT_ONE_CENT_BIGDECIMAL = new BigDecimal("0.01");

    public final static Integer ZERO_INT = 0;


    public static final Integer YES = 1;
    public static final Integer NO = 0;



    /**
     * DB suffix 库最大前缀
     */
    public static final Integer dbSuffix = 5;
    /**
     * table suffix  表最大前缀
     */
    public static final  Integer tableSuffix = null;




    /**
     *  是否进行cafeine缓存
     */
    public static final String CAFEINE_CACHE = "cafeineCache";


}
